import {getUserInfo} from "@/api/user.js"
export default {
	namespaced:true,
	state: {
		userinfo:'',
		token:uni.getStorageSync('token')||''
	},
	getters: {
		
	},
	mutations: {
		setUserInfo(state,val){//设置隆重详情数据
			state.userinfo=val
		},
		setSetTing(state,val){
			state.setting=val
		},
		setToken(state,val){
			uni.setStorageSync('token',val)
			state.token=val
		},
	},
	actions: { 
		async setUserInfo(state){
			console.log('设置用户数据')
			const res= await getUserInfo()
			state.commit('setUserInfo',res.data)
		}
	}
}